﻿using System;
using System.Collections.Generic;
using System.Text;
using XiaoGang.Soft.XGWMS.MODEL;
using XiaoGang.Soft.XGWMS.COM;

namespace XiaoGang.Soft.XGWMS.BLL
{
    public class BLL_M014BILLSCAN
    {
        DAL_SQL.DAL_M010_BILL dal_M010_BILL = new XiaoGang.Soft.XGWMS.DAL_SQL.DAL_M010_BILL();
        DAL_SQL.DAL_M014_BILLSCAN dal_M014_BILLSCAN = new XiaoGang.Soft.XGWMS.DAL_SQL.DAL_M014_BILLSCAN();

        /// <summary>
        /// <p><b>方法名称</b>SearchProcess</p>	
        /// <p><b>概要説明  :</b>货单一览的检索</p>	
        /// <p><b>作成者    :</b>万岗</p>	
        /// <p><b>作成日    :</b>2008/09/10</p>	
        /// <p><b>修改历史  :</b></p>	
        /// </summary>	 
        /// <param name="model">检索条件</param>
        /// <returns type = "ReturnValue">检索结果表</returns>
        public ReturnValue SearchProcess(MODEL.MOD_M010_BILL model)
        {
            return dal_M010_BILL.SearchProcess(model);
        }

        /// <summary>
        /// <p><b>方法名称</b>SearchGoodsDetail</p>	
        /// <p><b>概要説明  :</b>货单中商品信息的检索</p>	
        /// <p><b>作成者    :</b>万岗</p>	
        /// <p><b>作成日    :</b>2008/09/10</p>	
        /// <p><b>修改历史  :</b></p>	
        /// </summary>	 
        /// <param type="string" name="strBillID">货单编号</param>
        /// <returns type = "ReturnValue">检索结果表</returns>
        public ReturnValue SearchGoodsDetail(string strBillID)
        {
            return  dal_M014_BILLSCAN.SearchGoodsDetail(strBillID);
        }

        /// <summary>	
        /// <p><b>方法名称</b>SearchStorageDetail</p>
        /// <p><b>概要説明  :</b>商品进出库流水信息查询</p>
        /// <p><b>作成者	:</b>万岗</p>
        /// <p><b>作成日	:</b>2010/02/25</p>
        /// <p><b>修改历史  :</b></p>
        /// </summary>
        /// <param type="string" param="strGoodID">商品编号</param>
        /// <returns type="ReturnValue">查询结果</returns>
        public ReturnValue SearchStorageDetail(string strGoodID)
        {
            return dal_M014_BILLSCAN.SearchStorageDetail(strGoodID);
        }

        /// <summary>
        /// 取得商品[进][出][总]合计
        /// </summary>
        /// <param name="strGoodID"></param>
        /// <returns></returns>
        public ReturnValue GetAllUnits(string strGoodID)
        {
            return dal_M014_BILLSCAN.GetAllUnits(strGoodID);
        }

        /// <summary>
        /// 取得盘库商品
        /// </summary>
        /// <param name="strBill_ID">盘库编号</param>
        /// <param name="strStocktakingFlag">盘库标志:0=已盘+未盘 1=已盘 2=未盘</param>
        /// <param name="modGoods">商品过滤条件</param>
        /// <returns></returns>
        public ReturnValue GetStocktakingGoods(string strBill_ID, string strStocktakingFlag,MOD_M007_GOODS modGoods)
        {
            if (strStocktakingFlag == "0" || strStocktakingFlag == "1" || strStocktakingFlag == "2")
            {
                return dal_M014_BILLSCAN.GetStocktakingGoods(strBill_ID, strStocktakingFlag, modGoods);
            }
            else
            {
                return new ReturnValue(false, "E13002");//内部参数错误！
            }
        }

        public ReturnValue GetLastStocktakingID()
        {
            return dal_M014_BILLSCAN.GetLastStocktakingID();
        }
    }
}
